home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / ISSUE12 / WPTOOLS / WPTOOLS1.ZIP / DEMO / FastText / Unit2.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1996-07-04  |  1.6 KB  |  68 lines

  1. unit Unit2;
  2.  
  3. interface
  4.  
  5. {$IFDEF WIN32}
  6. uses
  7.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  8.   WpWinCtr, WPRich, WPRuler, ExtCtrls, WPTbar, StdCtrls, WPPrTab1, WPTxtDef,
  9.   Buttons, WPDefs, WPStatus, Wpstat2;
  10. {$ELSE}
  11. uses
  12.   WinProcs, WinTypes, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  13.   WpWinCtr, WPRich, WPRuler, ExtCtrls, WPTbar, StdCtrls, WPPrTab1, WPTxtDef,
  14.   Buttons, WPDefs, WPStatus, Wpstat2;
  15. {$ENDIF}
  16.  
  17. type
  18.   TPicSize = class(TForm)
  19.     XScrollbar: TScrollBar;
  20.     YScrollbar: TScrollBar;
  21.     Label1: TLabel;
  22.     Label2: TLabel;
  23.     Button1: TButton;
  24.     XL: TLabel;
  25.     YL: TLabel;
  26.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  27.     procedure XScrollbarChange(Sender: TObject);
  28.     procedure YScrollbarChange(Sender: TObject);
  29.     procedure FormShow(Sender: TObject);
  30.   private
  31.     { Private-Deklarationen }
  32.   public
  33.     { Public-Deklarationen }
  34.     XPt : Integer;
  35.     YPt : Integer;
  36.   end;
  37.  
  38. var
  39.   PicSize: TPicSize;
  40.  
  41. implementation
  42.  
  43. {$R *.DFM}
  44.  
  45. procedure TPicSize.FormClose(Sender: TObject; var Action: TCloseAction);
  46. begin
  47.    Xpt := XScrollBar.Position;
  48.    YPt := YScrollBar.Position;
  49. end;
  50.  
  51. procedure TPicSize.XScrollbarChange(Sender: TObject);
  52. begin
  53.    XL.Caption := IntToStr(XScrollBar.Position)+'pt';
  54. end;
  55.  
  56. procedure TPicSize.YScrollbarChange(Sender: TObject);
  57. begin
  58.  YL.Caption := IntToStr(YScrollBar.Position)+'pt';
  59. end;
  60.  
  61. procedure TPicSize.FormShow(Sender: TObject);
  62. begin
  63.    XScrollBar.Position := Xpt;
  64.    YScrollBar.Position := Ypt;
  65. end;
  66.  
  67. end.
  68.